package cn.tedu.mall1.order.controller;

import cn.tedu.mall1.base.response.JsonResult;
import cn.tedu.mall1.order.pojo.dto.OrderDTO;
import cn.tedu.mall1.order.pojo.response.PageData;
import cn.tedu.mall1.order.pojo.vo.OrderVO;
import cn.tedu.mall1.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/select")
    private JsonResult selectOrder(OrderDTO orderDTO){
        log.debug("查询订单接收的数据{}",orderDTO);
       // List<OrderVO> orderVO =  orderService.select(orderDTO);
        PageData data = orderService.select(orderDTO);
        return JsonResult.ok(data);
    }
}
